#ifndef WOLF_EVENT_HANDLER_TEST_HPP
#define WOLF_EVENT_HANDLER_TEST_HPP

#include "Manager.hpp"
#include "StdTest.hpp"


namespace wolf
{
    class EventHandlerTest : public StdTest
    {
    public:
        class MyEventHandler: public Manager
        {
        public:
            bool onEvent( Engine &engine, SDL_Event &event )
            {
                stamp( engine );
                cout << "Event caught: " << int( event.type ) << ";" << endl;
                return true;
            }
            bool onQuit( Engine &engine )
            {
                stamp( engine );
                cout << "Ending." << endl;
                return true;
            }
            void onDraw( Engine &engine, SDL_Surface *dst )
            {
                stamp( engine );
                cout << "Draw time;" << endl;
            }
            void onFrame( Engine &engine )
            {
                stamp( engine );
                cout << "Frame time;" << endl;
            }
            //
        private:
            void stamp( Engine &engine )
            {
                cout << "@" << engine.getCurrentFrame() << ": ";
            }
        } ;


        EventHandlerTest(): StdTest( "Event Handler Test" )
        {
            //
        }
        ~EventHandlerTest() {}

        bool run( Engine &engine )
        {
            MyEventHandler myEventHandler;
            engine.addManager( myEventHandler );
            while( engine.isRunning() )
            {
                engine.doFrame();
            }
            return true;
        }
    protected:

    private:

    };

}

#endif // WOLF_EVENT_HANDLER_TEST_HPP

